import { requestClient } from '#/api/request';

export interface SetPasswordDto {
  userId: string;
  password: string;
  confirmPassword: string;
}

export interface SetRoleDto {
  userId: string;
  roleNames: string[];
}

export async function setPasswordApi(dto: SetPasswordDto) {
  return await requestClient.post('/identity/api/user/setpassword', {
    userId: dto.userId,
    password: dto.password,
    confirmPassword: dto.confirmPassword,
  });
}

export async function setRoleApi(dto: SetRoleDto) {
  return await requestClient.post('/identity/api/user/setrole', {
    userId: dto.userId,
    roleNames: dto.roleNames,
  });
}
